﻿@model FTBS.Models.Entities.User

@{
    ViewBag.Title = "Chỉnh sửa nhà cung cấp";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h2 style="font-weight: bold">Chỉnh sửa thông tin nhà cung cấp</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.UserName)
    <table class="table striped bordered hovered" style="margin: 0px 0px 0px 40px">
        <tr>
            <th>Tên tài khoản 
            </th>
            <td>
                @this.Session["User"].ToString().Trim()
            </td>
        </tr>
        <tr>
            <th>Mật khẩu (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.PasswordFor(model => model.Password)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Password)</p>
                </div>
            </td>
        </tr>
        <tr>
            <th>Tên nhà cung cấp (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.FullName)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.FullName)</p>
                </div>
            </td>
        </tr>
        <tr>
            <th>Địa chỉ (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Address)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Address)</p>
                </div>
            </td>
        </tr>
        <tr>
            <th>Email (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Email)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Email)</p>
                    @if (ViewBag.Email != null)
                    { 
                    <p style="color: red; font-size: 10pt">Email này đã tồn tại!</p>
                    }
                </div>
            </td>
        </tr>
        <tr>
            <th>Số điện thoại (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.PhoneNumber)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.PhoneNumber)</p>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input class="large info" type="submit" value="Lưu" />
            </td>
        </tr>
    </table>
}

<div>
    @Html.ActionLink("Quay Lại", "Index")
</div>


